from Base.Base import Base
from selenium.webdriver.common.by import By
from Config.Config import Config

# lcx
'''登录页面'''
class Login(Base):
    # 登录
    name_loc = (By.XPATH, '/html/body/div/div[2]/div[1]/form/div[2]/ul[1]/li[2]/input')

    def name(self):
        self.send_keys(self.name_loc, 'admin')

    pwd_loc = (By.NAME, 'roncooPwd')

    def pwd(self):
        self.send_keys(self.pwd_loc, '123456')

    login_Btn = (By.XPATH,'//*[@id="form1"]/div[3]/input')
    def login_btn(self):
        self.click(self.login_Btn)

    # 登录
    def login(self):
        login_url = Config().get_login_url()
        # 打开网址
        self.open_url(login_url)
        # 输入账号
        self.name()
        self.pwd()
        self.login_btn()


